Skip to content

build: enable -Wall for Iceberg C++ libraries - #1189

Open
zhjwpku wants to merge 4 commits into
apache:mainfrom
zhjwpku:build/enable-wall
Open

zhjwpku wants to merge 4 commits into
apache:mainfrom
zhjwpku:build/enable-wall

Conversation

@zhjwpku

@zhjwpku zhjwpku commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

The x86-64 CI builds for #1126 compiled the Mumbling SSE2 path with -Werror, but the compiler had no reason to report the unused scalar helper. Enable -Wall alongside the existing warnings-as-errors policy for Iceberg's static and shared C++ libraries on GCC, Clang and AppleClang. The option is private to those targets.

Clean up the warnings exposed by that change. In particular, ResidualEvaluator::Unpartitioned() returns a derived object through a unique_ptr<ResidualEvaluator>, so the base destructor needs to be virtual. This changes the exported class's vtable. The remaining fixes remove unused code, preserve both inherited Apply overloads in cherry-pick operations, and keep metadata builder error propagation while discarding unused IDs.

The first commit carries #1188 so x86-64 can build with the new policy. GCC also diagnosed mixed-sign comparisons and a validation loop whose body disappears under NDEBUG. The comparisons now account for signed counts and limits, and the scan-task group validates its elements inside the debug assertion.

Verification

  • Compiled mumbling_bitmap.cc with AppleClang 17 and -Wall -Werror. The previous source fails on x86-64 with -Wunused-function, and the updated source passes on both x86-64 and arm64.
  • Checked the generated compilation database for the local static build. All 212 Iceberg library commands have -Wall -Werror, and the option does not propagate to the expression and utility test targets.
  • Compiled mumbling_bitmap.cc and table_scan.cc with x86-64 Linux GCC 14.4 in Debug and with -O2 -DNDEBUG.
  • Built the local AppleClang 17 static configuration and ran 21 CTest suites successfully. Two additional suites, scan_test and parquet_test, use std::ranges::iota, which the local macOS 15.5 SDK does not provide. Both are part of the upstream Test workflow.
  • pre-commit run --all-files passed.

Codex assisted with the implementation and verification.

Enable common warnings on Iceberg library targets built with GCC or Clang. The existing warnings-as-errors policy then catches unused helpers in architecture-specific builds. Fix the diagnostics in existing library sources, including destruction through the ResidualEvaluator base class.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant